package com.passion.mq.rabbitmq.queue1;

import com.passion.mq.config.RabbitMqConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Configuration;

/**
 * 类描述：用户操作消息队列配置类
 *
 * @author ZhuYin
 * @since 2024年12月31日
 */
@Configuration("userOperationRabbitMqQueueConfig")
@ConditionalOnBean(RabbitMqConfig.class)
public class UserOperationQueueConfig {

    /**
     * 业务描述
     */
    public static String description;
    /**
     * 队列名称
     */
    public static String queueName;
    /**
     * 消费者的并发数
     */
    public static Integer consumerConcurrency;


    @Value("${archives.mq.business[0].description}")
    public void setDescription(String description) {
        UserOperationQueueConfig.description = description;
    }

    @Value("${archives.mq.business[0].queueName}")
    public void setQueueName(String queueName) {
        UserOperationQueueConfig.queueName = queueName;
    }

    @Value("${archives.mq.business[0].consumerConcurrency}")
    public void setConsumerConcurrency(Integer consumerConcurrency) {
        UserOperationQueueConfig.consumerConcurrency = consumerConcurrency;
    }

}
